//
// Created by jsjxsy on 2022/9/9.
//演讲比赛管理系统
//
#include <iostream>
#include <SpeechManager.h>
using namespace std;
void showSpeakers(SpeechManager sm) {
  for (map<int, Speaker>::iterator it = sm.m_speaker.begin(); it != sm.m_speaker.end(); it++) {
    cout << "选手编号：" << it->first
         << " 姓名： " << it->second.m_name
         << " 成绩： " << it->second.m_score[0] << endl;
  }
}

void process() {
  SpeechManager sm;
  while (true) {
    sm.showMenu();
    cout << "请选择菜单项:" << endl;
    int selected = 0;
    cin >> selected;
    switch (selected) {
      case 0:sm.exit();
        break;
      case 1:sm.startSpeech();
        break;
      case 2:sm.showRecord();
        break;
      case 3:sm.clearRecord();
        break;
      case 4:showSpeakers(sm);
      default:system("clear");
        break;
    }
  }
}

int main() {
  srand((unsigned int)time(NULL));
  process();
  return 0;
}